package cn.schoolwow.quickdao.test.module.business.user.log.testcase;

import cn.schoolwow.quickdao.domain.DAO;
import cn.schoolwow.quickdao.domain.database.parent.DatabaseStatementFilterType;
import cn.schoolwow.quickdao.domain.database.parent.RealTimePrintStatementOption;
import cn.schoolwow.quickdao.test.module.business.user.ddl.testcase.CreatePositionTestCaseFlow;
import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;

public class RealTimePrintStatementTestCaseFlow implements BusinessFlow {
    @Override
    public void executeBusinessFlow(FlowContext flowContext) throws Exception {
        DAO dao = flowContext.checkInstanceData(DAO.class);

        RealTimePrintStatementOption realTimePrintStatementOption = new RealTimePrintStatementOption();
        realTimePrintStatementOption.databaseStatementFilterType = DatabaseStatementFilterType.OnlyShowUpdate;
        realTimePrintStatementOption.tableNameList.add("user");
        dao.realTimePrintStatement(realTimePrintStatementOption);

        flowContext.executeFlowList(new CreatePositionTestCaseFlow());
    }

    @Override
    public String name() {
        return "实时打印SQL日志测试用例";
    }
}
